package cn.ulc.socket.weapp.controller;

import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;
import cn.ulc.common.util.Result;
import cn.ulc.socket.weapp.service.ActivityServ;
import cn.ulc.socket.weapp.service.NoticeServ;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(value = "/wechat/activity")
public class ActivityController {
    private static final Log log = LogFactory.get();

    @Autowired
    ActivityServ activityServ;
    @Autowired
    NoticeServ noticeServ;


    @GetMapping("/findByCode")
    public Result findByCode(String code){
        return Result.success(activityServ.findByCode(code));
    }
    @GetMapping("/findNoticeByCategory/{categoryId}")
    public Result findNoticeByCategory(@PathVariable("categoryId") Long categoryId){
        return Result.success(noticeServ.findNoticeByCategory(categoryId));
    }

}
